package com.lemon.components.video.bean;

import org.springframework.util.Assert;

import com.lemon.components.video.enums.H264LevelEnum;
import com.lemon.components.video.enums.H264Preset;
import com.lemon.components.video.enums.H264ProfileEnum;

/**
 * 
 * @author jianglu
 * ffmpeg -i M.MOV -acodec aac -vcodec libx264 -b 1000k -bufsize 2000k -r 30 -s 800*600 -aspect 16:9 1111.mp4
 */
public class VideoCoverOrder {

	private String videoInputPath;
	private String videoOutputPath;
	private String videoCodec = "libx264";
	private String audioCodec = "aac";
	private String videoBitrate = "1000k";
	private String audioBitrate = "1000k";
	private float fps = 30;
	private String size;
	private String aspect = "16:9";
	private String ffmpeglib;
	private float maxrate;
	private H264Preset preset;
	private H264ProfileEnum profile;
	private H264LevelEnum level;
	
	public void check(){
		Assert.notNull(this.videoInputPath, "视频输入为空");
		Assert.notNull(this.videoOutputPath, "视频输出为空");
		Assert.notNull(this.ffmpeglib, "ffmpeg函数库为空");
	}
	
	public String getVideoInputPath() {
		return videoInputPath;
	}
	/**
	 * 
	 * <font size="3" color="red">视频转换路径</font><br>
	 * <ol>
	 * <li></li>
	 * </ol>
	 * @param videoInputPath <font size="2" color="blue"></font>
	 */
	public void setVideoInputPath(String videoInputPath) {
		this.videoInputPath = videoInputPath;
	}
	public String getVideoOutputPath() {
		return videoOutputPath;
	}
	/**
	 * 
	 * <font size="3" color="red">视频输出路径</font><br>
	 * <ol>
	 * <li></li>
	 * </ol>
	 * @param videoOutputPath <font size="2" color="blue"></font>
	 */
	public void setVideoOutputPath(String videoOutputPath) {
		this.videoOutputPath = videoOutputPath;
	}
	public String getVideoCodec() {
		return videoCodec;
	}
	/**
	 * 
	 * <font size="3" color="red">视频编码器</font><br>
	 * <ol>
	 * <li></li>
	 * </ol>
	 * @param videoCodec <font size="2" color="blue"></font>
	 */
	public void setVideoCodec(String videoCodec) {
		this.videoCodec = videoCodec;
	}
	public String getAudioCodec() {
		return audioCodec;
	}
	/**
	 * 
	 * <font size="3" color="red">音频编码器</font><br>
	 * <ol>
	 * <li></li>
	 * </ol>
	 * @param audioCodec <font size="2" color="blue"></font>
	 */
	public void setAudioCodec(String audioCodec) {
		this.audioCodec = audioCodec;
	}
	public float getFps() {
		return fps;
	}
	/**
	 * 
	 * <font size="3" color="red">视频帧，默认30</font><br>
	 * <ol>
	 * <li></li>
	 * </ol>
	 * @param fps <font size="2" color="blue"></font>
	 */
	public void setFps(float fps) {
		this.fps = fps;
	}
	public String getSize() {
		return size;
	}
	/**
	 * 
	 * <font size="3" color="red">视频分辨率，默认800*600</font><br>
	 * <ol>
	 * <li></li>
	 * </ol>
	 * @param size <font size="2" color="blue"></font>
	 */
	public void setSize(String size) {
		this.size = size;
	}
	public String getAspect() {
		return aspect;
	}
	/**
	 * 
	 * <font size="3" color="red">屏幕比例，默认16:9</font><br>
	 * <ol>
	 * <li></li>
	 * </ol>
	 * @param aspect <font size="2" color="blue"></font>
	 */
	public void setAspect(String aspect) {
		this.aspect = aspect;
	}
	@Override
	public String toString() {
		return "{videoInputPath:\"" + videoInputPath + "\", videoOutputPath:\"" + videoOutputPath + "\", videoCodec:\"" + videoCodec + "\", audioCodec:\"" + audioCodec + "\", videoBitrate:\"" + videoBitrate + "\", audioBitrate:\"" + audioBitrate + "\", fps:\"" + fps + "\", size:\"" + size + "\", aspect:\"" + aspect + "\", ffmpeglib:\"" + ffmpeglib + "\", maxrate:\"" + maxrate + "\", preset:\"" + preset + "\", profile:\"" + profile + "\", level:\"" + level + "}";
	}
	public String getFfmpeglib() {
		return ffmpeglib;
	}
	/**
	 * 
	 * <font size="3" color="red">ffmpeg库路径</font><br>
	 * <ol>
	 * <li></li>
	 * </ol>
	 * @param ffmpeglib <font size="2" color="blue"></font>
	 */
	public void setFfmpeglib(String ffmpeglib) {
		this.ffmpeglib = ffmpeglib;
	}

	public String getVideoBitrate() {
		return videoBitrate;
	}
	/**
	 * 
	 * <font size="3" color="red">视频流大小，默认1000k</font><br>
	 * <ol>
	 * <li></li>
	 * </ol>
	 * @param videoBitrate <font size="2" color="blue"></font>
	 */
	public void setVideoBitrate(String videoBitrate) {
		this.videoBitrate = videoBitrate;
	}

	public String getAudioBitrate() {
		return audioBitrate;
	}

	/**
	 * 
	 * <font size="3" color="red">音频流，默认1000k</font><br>
	 * <ol>
	 * <li></li>
	 * </ol>
	 * @param audioBitrate <font size="2" color="blue"></font>
	 */
	public void setAudioBitrate(String audioBitrate) {
		this.audioBitrate = audioBitrate;
	}

	public float getMaxrate() {
		return maxrate;
	}

	public void setMaxrate(float maxrate) {
		this.maxrate = maxrate;
	}

	public H264Preset getPreset() {
		return preset;
	}

	public void setPreset(H264Preset preset) {
		this.preset = preset;
	}

	public H264ProfileEnum getProfile() {
		return profile;
	}

	public void setProfile(H264ProfileEnum profile) {
		this.profile = profile;
	}

	public H264LevelEnum getLevel() {
		return level;
	}

	public void setLevel(H264LevelEnum level) {
		this.level = level;
	}
	
}
